package club.pchome.service;

import club.pchome.common.util.PageUtil;
import club.pchome.dao.CUserDao;
import club.pchome.dto.Result;
import club.pchome.model.CUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.HashMap;
import java.util.Map;


@Service
public class CUserService extends BaseService{

    @Autowired
    CUserDao cUserDao;

    public PageUtil<CUser> userList(PageUtil<CUser> pu, Map<String, Object> map) {
        pu.pageUtilHandle(cUserDao.userListCount());
        map.put("startRow", pu.getStartRow());
        map.put("pageSize", pu.getPageSize());
        pu.setDataList(cUserDao.userList(map));
        return pu;
    }

    public int userCount(){
        return cUserDao.userListCount();
    }

    public int todayRegCount(){
        return cUserDao.todayRegCount();
    }
}
